package com.qujia.station.domain.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@ApiModel
public class StationOillGunPriceForm {

    @ApiModelProperty(value = "生效日期", position = 1)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotEmpty(message = "生效时间不能为空")
    private Date effectDate;

    @ApiModelProperty(value = "调价消息推送时间", position = 2)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date pushDate;

    @ApiModelProperty(value = "调价的油品", position = 3)
    private List<StationOillGunPriceForm.StationOillGunPrice> stationOillGunPriceList;


    @ApiModelProperty(value = "油站id", position = 4)
    @Setter
    @Getter
    @NotEmpty(message = "油站id不能为空")
    private Long stationId;

    @ApiModelProperty("是否立即推送消息")
    private String isPush;

    public Date getEffectDate() {
        return effectDate;
    }

    public void setEffectDate(Date effectDate) {
        this.effectDate = effectDate;
    }

    public Date getPushDate() {
        return pushDate;
    }

    public void setPushDate(Date pushDate) {
        this.pushDate = pushDate;
    }

    public List<StationOillGunPrice> getStationOillGunPriceList() {
        return stationOillGunPriceList;
    }

    public void setStationOillGunPriceList(List<StationOillGunPrice> stationOillGunPriceList) {
        this.stationOillGunPriceList = stationOillGunPriceList;
    }

    public String getIsPush() {
        return isPush;
    }

    public void setIsPush(String isPush) {
        this.isPush = isPush;
    }

    @ApiModel
    public static class StationOillGunPrice {

        @ApiModelProperty(value = "油品id", position = 1)
        private Long oilId;

        @ApiModelProperty(value = "油枪价格", position = 1)
        @Min(value = 0,message = "请输入正确的价格")
        private BigDecimal oilStationPrice;

        @ApiModelProperty(value = "发改委指导价", position = 1)
        private BigDecimal oilOfficialPrice;

        @ApiModelProperty(value = "优惠价(仅展示用)", position = 1)
        private BigDecimal discountPrice;

        public Long getOilId() {
            return oilId;
        }

        public void setOilId(Long oilId) {
            this.oilId = oilId;
        }

        public BigDecimal getOilStationPrice() {
            return oilStationPrice;
        }

        public void setOilStationPrice(BigDecimal oilStationPrice) {
            this.oilStationPrice = oilStationPrice;
        }

        public BigDecimal getOilOfficialPrice() {
            return oilOfficialPrice;
        }

        public void setOilOfficialPrice(BigDecimal oilOfficialPrice) {
            this.oilOfficialPrice = oilOfficialPrice;
        }

        public BigDecimal getDiscountPrice() {
            return discountPrice;
        }

        public void setDiscountPrice(BigDecimal discountPrice) {
            this.discountPrice = discountPrice;
        }
    }
}
